<template>
  <div class="custom-body" :style="borderStyle">
    <div class="body-custom" :style="bodyStyle">
      <div v-if="showHeader && temp.sfxsbt" class="custom-header">
        <div class="header-body">
          <div v-if="temp.sfsxtb === true" class="header-icon">
            <i :class="temp.tb" />
          </div>
          <div class="header-title">
            <span class="title-span">{{ temp.name }}</span>
          </div>
          <div
            v-if="temp.isMore === true"
            class="header-icon more"
            @click="callBack"
          >
            查看更多>>
          </div>
        </div>
      </div>
      <div class="custom-content">
        <el-empty
          v-if="dataList === null || dataList.length === 0"
          :image-size="100"
        />
        <div v-else class="layout-ui">
          <div
            v-for="(obj, index) in dataList"
            :key="'obj-' + index"
            class="custom-ul-li"
            :loading="loading"
            @click="openEntity(obj)"
          >
            <div class="custom-li-title">
              <span><i class="el-icon-caret-right" /></span>
              {{ obj[column['title']] }}
            </div>
            <div class="custom-li-span">
              {{ obj[column['time']] }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mobile } from '@/mixins/mobile'

export default {
  name: 'AppNewListTempV3', // app学校新闻
  mixins: [mobile({ tabs: 'temp' })]
}
</script>

<style lang="scss" scoped>
.custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.body-custom {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
}

.custom-header {
  width: 100%;
  height: 50px;
  flex: 0 1 auto;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 50px;
  cursor: pointer;
}

.header-body {
  width: 100%;
  height: 51px;
  display: flex;
  flex-flow: row nowrap;
}

.header-icon {
  width: 20px;
  height: 50px;
  flex: 0 1 auto;
  text-align: center;
  color: #409eff;
  font-size: 1.1rem;
}

.header-icon.more {
  width: 85px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: right;
}

.header-title {
  height: 50px;
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.title-span {
  height: 40px;
  padding: 12px 5px;
  box-sizing: border-box;
  line-height: 40px;
  text-align: center;
  position: relative;
  font-weight: bolder;
}

.custom-content {
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  padding: 0 10px 10px 10px;
  overflow: hidden;
  box-sizing: border-box;
}
.custom-ul-li {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  .custom-li-title {
    flex: 1 1;
    height: 40px;
    line-height: 40px;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .custom-li-span {
    width: 80px;
    height: 40px;
    line-height: 40px;
    font-size: 0.8rem;
    color: #666666;
    text-align: right;
  }
}
.custom-ul-li:not(:last-child) {
  border-bottom: 1px solid #ebeef5;
}
.layout-ui {
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  border-radius: 6px;
  padding: 10px;
}
</style>
